#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
struct node {
    int x,pos;
} a[33];
bool cmp(node a, node b) {
    return a.x>b.x;
}
int main() {
    int n;
    cin>>n;
    int cnt=0;
    for (int i=1; i<=n; ++i) {
        cin>>a[i].x;
        cnt+=a[i].x;
        a[i].pos=i;
    }
    sort(a+1, a+n+1, cmp);
    cnt-=a[1].x;
    if (a[1].x>cnt) printf("impossible\n");
    else {
        for (int i=1; i<=n; ++i) printf("%d%c", a[i].pos, (i==n? '\n' : ' '));
    }
    return 0;
}
